Skip to content

Git test environment consistency#2152

Draft
elovelan wants to merge 2 commits into
gitpython-developers:mainfrom
elovelan:test_hardening
Draft

Git test environment consistency#2152
elovelan wants to merge 2 commits into
gitpython-developers:mainfrom
elovelan:test_hardening

Conversation

@elovelan
Copy link
Copy Markdown

@elovelan elovelan commented May 12, 2026

When implementing #2151, I ran into a few issues running tests due to:

  1. By default, GitHub now forks only the default branch when forking a repo. One of the docs tests was relying on origin/master existing, which is unlikely in a fork scenario, since the common pattern is to set origin to the fork and upstream to the primary repo.
  2. I have a few "convenience" features in my configuration such as main as the default repo branch name and fetch.prune=true. These break some of the tests so it seemed like it might be a good idea to always use a consistent config file.

elovelan added 2 commits May 12, 2026 16:53
Since there are many ways to configure git, use a standard configuration file,
so tests always run with consistent settings
The remote test relied on a full repo clone that included all branches, which
isn't guaranteed, especially in CI environments and when using repo forks. Use
the cloned repo instead, since it will still test the desired functionality but
will always have the necessary upstream branch.
@elovelan
Copy link
Copy Markdown
Author

I'll spin up a Windows VM for testing!

@elovelan
Copy link
Copy Markdown
Author

@Byron, this is actually a little bigger than I had anticipated since there's a bit of config manipulation in the Actions workflows. If you like this approach, I'm happy to bring those settings over but I wanted to check with you first!

@Byron
Copy link
Copy Markdown
Member

Byron commented May 13, 2026

The test suite unfortunately has never been isolated, and this bites from time to time.
Let's make the changes that are needed on CI to make it more resilient. We just have to watch out that these alterations don't affect local runs.

@elovelan elovelan marked this pull request as draft May 14, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants